From: Marco Trevisan (TreviƱo) Date: Wed, 9 Jul 2025 03:56:27 +0000 (+0200) Subject: network: Make sortByName to properly handle null values X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~119^2~4^2^2~14 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=18199ec69cfbb8d6804f427d1a1454360a6d464d;p=gnome-shell.git network: Make sortByName to properly handle null values g_utf8_collate is not nullable, but is used in a relevant piece of code, so better not to throw any error if a null value is compared Part-of: (cherry picked from commit 674cfd49f297dd438e5fcefc8ad2dbedeeda2af0) --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 25247f7de..7e06775d7 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -116,7 +116,7 @@ class ItemSorter { } _sortByName(one, two) { - return GLib.utf8_collate(one.name, two.name); + return GLib.utf8_collate(one.name ?? '', two.name ?? ''); } _sortByMru(one, two) {